home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 214
/
214.d81
/
t.tiny grafix
< prev
next >
Wrap
Text File
|
2022-08-26
|
4KB
|
171 lines
u
TINY GRAFIX
by Dave Moorman
The goal is to make a "true" morph
program, when images proportionally
shift one to another. Doing this on a
full bitmap screen would be a long and
tedious process -- not to mention
using huge amounts of disk space.
So, in preparation, I developed
Tiny Grafix, a small, text/font bitmap
that can be placed anywhere on a text
screen. Actually, the Tiny screen can
be 96 x 80 or 152 x 80 pixels in size.
In both sizes, the unshifted text
letters are still available. With a 96
x 80 screen, you can have both upper
and lower case text.
While I was at it, I decided to
try to create a self-running data
file. That is to say, if you bload the
file to page 64, then a SYS64*256
(plus parameters) will display the
graphic. This requires fully
relocateable ML code.
Don't gasp! Long ago, Jeff Jones
explained that relocatable code is
possible as long as you:
1. Use Branches instead of Jumps
2. Never use JSRs (or JMPs) to
locations inside the program.
3. Never load from locations
inside the program.
And that would be all fine and
dandy -- except Subroutines are [so]
convenient! Reading the parameters
without subroutines would be sloppy
coding.
However, I [can] JSR outside the
code. And when the program does a JSR,
the return memory location is stuffed
in the processor stack. And, YES! I
can get the index pointer to the stack
(TSX), and retrieve the location of
the program.
Then for each label in the program
that marks a subroutine, the set-up
code creates a jump vector (in the
casette buffer). The overhead for
doing this is about 24 bytes for each
subroutine label.
[USING TINY GRAFIX]
But enough bragz. A Tiny Grafix
file must be created with Tiny Maker,
using any high-res bitmap in SHP
format. A good trick is to use DOODLE!
to shrink a full screen to the 96 x 80
or 152 x 80 size. For full
documentation of Tiny Maker, see the
program on this issue.
However, I have included several
Tiny Grafix files (they have the .TINY
extension) on this issue for you to
play with. You must bload the file
into any free, open memory (not under
ROM or I/O). Each file is exactly 2048
bytes -- 8 pages.
SYS57812"tiny1.tiny",d,0:pO780,0:
pO781,0:pO782,pg:sys65493
where "d" is the drive
and "pg" is the memory page
You must be using a custom font.
To display the Tiny Graphic, use
the following command:
SYSpg*256,x,y,fpg,mode
where
pg is the memory page where the file
starts,
x is the text column and
y is the text row of the upper left
corner of the graphic
fpg is the memory page of your custom
font.
mode is your choice of actions:
0 Clear graphic area of font, put
on screen, copy Tiny Grafic.
1 Clear Screen, then do mode 0.
2 Copy Tiny Grafic (must do mode 0
1 or 3 first).
3 Clear graphic area of font, put
on screen.
I had a few bytes left in the
file, so I added a small plot routine.
You MUST use the above command first!
(It makes the jump vector table.)
Besides, you will want to do a mode 3
at least to put the Tiny bitmap on the
screen.
sys pg+3,x,y,fpg,mode
where x is the pixel column and
y is the pixel row.
fpg is the page of your custom
font.
mode is:
0 pixel off
1 pixel on
3 pixel toggled
4 look at pixel
In mode 4, PEEK(780) will return
0 if the pixel is off and 1 if the
pixel is on.
That's the basics. Stay tuned,
LOADSTARites! Next month will bring a
fairly complete "stationary" drawing
package for the Tiny Grafix screen.
By the way, this screen is
designed the way demo dudes do their
great sinus plots. The characters are
stacked 10 high. The Y coordinate is
easy -- put it in .Y! For the X coord,
the program does AND#%11111000 (then
multiplies the result by 10), and
AND#%00000111 (to index the pixel
within the byte).
That's it for now. Stay tuned,
LOADSTARites. A full feature graphics
package for Tiny Grafix is on the way!
DMM